import React from 'react'
import './demo3.css'
import store from '@/store'
import { Button, Input } from 'antd'

class Demo3 extends React.Component {

  state = {
    ...store.getState()
  }

  componentDidMount() {
    console.log(this.state)
  }

  render() {
    let { list, value } = this.state
    return (
      <div className="demo3">
        <div className="list">
          {
            list.map((item, index) => {
              return (
                <div className="list-item" key={ index }>{ item }</div>
              )
            })
          }
        </div>
        <Input value={ value }></Input>
        <Button>新增</Button>
      </div>
    )
  }

}

export default Demo3